<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/24
 * Time: 17:42
 */
namespace app\api\validate;

class IDConllection extends BaseValidate {

    protected $rule = [
        'ids'=>'require|checkIDs'
    ];

    protected $message = [
        'ids'=>'ids参数格式不合法'
    ];

    /**
     * 验证themeUrl格式
     * @param $value
     *
     * @return bool
     */
    protected function checkIDs($value){
        $valueData = explode(',',$value);
        if(empty($valueData)){
            return false;
        }
        foreach ($valueData as $id){
            if(!$this->isPositveInteger($id)){
                return false;
            }
        }
        return true;
    }

}